Show minor edits - Show changes to markup
Here is the link to download the example *.map file used in this tutorial.
Here is the link to download the example *.map file used in this tutorial: Attach:areaportal_tutorial.zip
http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=9: - invalid file extension -
http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=10: - invalid file extension -
http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=11: - invalid file extension -
http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=12: - invalid file extension -
http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=13: - invalid file extension -
http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=14: - invalid file extension -
http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=15: - invalid file extension -
http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=16: - invalid file extension -
http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=17: - invalid file extension -
http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=18: - invalid file extension -
http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=8: - invalid file extension -
Tutorial has not yet been transfered from http://www.planetmedalofhonor.com/rjukanproject/
This tutorial will attempt to teach by example how to use the common/areaportal texture.
(:toc:)
You know that the map V2 Facility has one of the best FPS:es among the maps shipped with MOH:AA... Not really that strange as there are a lot of corridors that does not show that much of the map at once, so there is not a lot to draw for the graphic engine. But there is another reason that the blazing FPS of the V2 Facility has been achieved as well... If you have a modest or bad computer: you may have noticed that FPS drops every time the doors to the V2 area is open... this is because the V2 area is not drawn when they are closed.
So? You say... naturally the things I cant see is not drawn!
Well, this is unfortunately not true. Especially when it comes to doors. But it can be true if you learn to use areaportals.
Consider these three rooms: http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=8: - invalid file extension - ...the picture above shows three rooms. Two of them contains some complex brushes. One contains the player starting points and nothing more. The rooms are connected with short corridors. At both ends of the corridors, there are doors.
Normally every brush in this little map will be drawn all the time.
If you doubt me, soon is the time for you to look like this: (o_0) ...and yell Eureka!
The doors to the room with the sphere has no area portals, the doors to the room with the twelve cones does contain area portals. Now lets look at the rooms from the middle room using the r_showtris 2 command ( if you don't know this command, learn about it here? ).
The two doors without areaportals:
With both doors open: http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=9: - invalid file extension - With the farthest door closed: http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=10: - invalid file extension -
With both doors closed: http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=11: - invalid file extension - ...as you can see: The contents of the room is draw even if there are two closed doors in the way. If this is news to you, make this face now: (o_0)
Now the two doors with areaportals: With both doors open: http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=12: - invalid file extension - With the farthest door closed: http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=13: - invalid file extension - With both doors closed: http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=14: - invalid file extension -
...this is what I expect many of you thought happened all the time a door closed. But not without some area portals and some conscious architectural decisions.
Area portals work together with structural brushes ( if you don't know what a structural brush is, read "Vis for Dummies" ) to create a closed section in the map: a separate area. When an area is closed, it is not drawn if you are outside that area And if you are inside a closed area, nothing outside it is drawn. To close an area, you need it to be totally sealed off from the rest of the map with a combination of area portals and structural brushes.
To create a separate area, it must be sealed. No translucent brushes ( like windows and water) and no fence textures ( like iron gates or fences ) and no entities ( other than doors ) can be part of the sealing off of the area.
If you have a func_rotatingdoor entity like this ( door selected in red ): http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=15: - invalid file extension - ...place a brush with the common/areaportal texture like this ( area portal selected i red ): http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=16: - invalid file extension - ... so that is sticks out into the ( structural ) wall a few units. It should be:
Here is how it should look in MOHRadiant ( You can't see the area portal brush ): http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=17: - invalid file extension - ...and here is the same view with the View->Filter->Entities activated ( a func_rotatingdoor is an entity ): http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=18: - invalid file extension - That's it!
Sooner or later you will for some reason want to manually activate and deactivate an area portal instead of doing it "automagically" with a door. An example of this is when you create a hatch in the floor/ceiling that turns up or down by executing a move command on a script_object entity in the script of the map, like this:
$hatch rotateXup 90
In this case you will have to deactivate the area portal manually once the hatch starts to open, and activate it once it has been closed again. This is done with these two simple commands:
$my_hatch closeportal // Closes the area portal and seals the area
and
$my_hatch openportal // Opens the area portal, exposing the area
Observe that you are NOT giving the openportal and closeportal commands to the area portal itself. You actually give it to an entity that touches the area portal. The example *.map file in the next section contains a scripted hatch that controls an area portal manually.
Here is the link to download the example *.map file used in this tutorial.
This concludes this tutorial. Time to yell EUREKA
EUREKA!
Tutorial has not yet been transfered from http://www.planetmedalofhonor.com/rjukanproject/